package com.sh.data.engine.web.webapi.controller.certificate;

import com.sh.data.engine.application.service.authority.CertificateApplicationService;
import com.sh.data.engine.domain.authority.model.domain.MenuDomain;
import com.sh.data.engine.web.webapi.controller.base.response.RestResponseEntity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: mengzheng.mhc
 * @date: 2024/7/24 16:54
 */
@Validated
@RequestMapping("/certificate")
@RestController
@Tag(name = "证书", description = "证书相关API")
public class CertificateController {

    @Autowired
    private CertificateApplicationService certificateApplicationService;

    /**
     * @description : 获取当前用户可以访问的菜单列表
     * @author : tinglan.ys
     * @date : 2022/1/7
     */
    @GetMapping("/getMenus")
    @Operation(summary = "获取当前用户可以访问的菜单列表")
    public RestResponseEntity<List<MenuDomain>> getMenus(@RequestParam String userId) {
        var result = certificateApplicationService.getMenus(userId);
        return RestResponseEntity.success(result);
    }
}
